# 计算1~100的和
_sum = 0
num = 1
while num <= 100:
    _sum += num
    num += 1

print(f"最终得到的sum={_sum}")


# 计算5的阶层
num = 1
_sum = 1
while num <= 5:
    _sum *= num
    num+= 1

print(f"最终得到5的阶乘为{_sum}")


# 计算 1~5的阶乘
num = 1
tmp = 1
_sum= 0
while num <= 5:
    tmp *= num
    _sum += tmp
    num += 1
print(f"得到1~5的阶乘为{_sum}")